//
//  TitleViewController.m
//  Clock
//
//  Created by 郭明皓 on 16/6/23.
//  Copyright © 2016年 郭明皓. All rights reserved.
//

#import "TitleViewController.h"
#import "AddViewController.h";
@interface TitleViewController ()
@property (weak, nonatomic) IBOutlet UITextField *titles;

@end

@implementation TitleViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.titles.text = self.title;
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"完成" style:UIBarButtonItemStyleDone target:self action:@selector(success:)];
}

- (void)success:(UIBarButtonItem *)down {
    
    self.block(self.titles.text);
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
